package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.bwie.poi.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 订单表
 * @TableName tb_order
 */
@TableName(value ="tb_order")
@Data
public class TbOrder implements Serializable {
    /**
     * 订单ID
     */
    @TableId(type = IdType.AUTO)
    @Excel(name = "订单ID", sort = 1)
    private Integer orderId;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号", sort = 2)
    private Long orderNo;

    /**
     * 订单类型：0普通订单1秒杀订单2团购订单
     */
    @Excel( name = "订单类型", sort = 3, readConverterExp= "0=普通订单,1=秒杀订单,2=团购订单")
    private Integer orderType;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 商品信息
     */
    @Excel(name = "商品信息", sort = 4)
    private String prodInfo;

    /**
     * 订单金额
     */
    @Excel(name = "订单金额", sort = 4)
    private BigDecimal amount;

    /**
     * 创建时间
     */
    @Excel(name = "订单时间", sort = 4, dateFormat= "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date createTime;

    /**
     * 订单状态：0待支付1已支付2待发货3已签收
     */
    @Excel( name = "订单类型", sort = 3, readConverterExp= "0=待支付,1=已支付,2=待发货,3=已签收")
    private Integer orderStatus;

    /**
     * 物流信息
     */
    private String delivery;

    /**
     * 支付时间
     */
    private Date payTime;

    /**
     * 购买数量
     */
    private Integer prodNum;

    /**
     * 使用积分
     */
    private Integer useScore;

    /**
     * 优惠券ID
     */
    private Integer coupon;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 更新人
     */
    private Date updateBy;

    /**
     * 买家姓名
     */
    @TableField(exist = false)
    private String nickName;

    @TableField(exist = false)
    private List<String> imageList;

    /**
     * 商品明细列表
     */
    @TableField(exist = false)
    private List<TbOrderDetail> orderDetailList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}